extends layout

block content
    h1= title
    form(method='post' action='')
        div.form-group
            label(for='book') 所属书名:
            select#book.form-control(type='select', placeholder='please select book', name='book', required='true')
                for item in books
                    if book_instance
                        option(value=item._id selected=(item._id.toString()===book_instance.book.toString()?'selected':false)) #{item.title}
                    else
                        option(value=item._id) #{item.title}
        div.form-group
            label(for='imprint') Imprint:
            input#imprint.form-control(type='text' name='imprint' value=(undefined === book_instance ? '' : book_instance.imprint) required='true')
        div.form-group
            label(for='status') 状态:
            select#status.form-control(type='select', placeholder='please select 状态', name='status')
                //['可供借阅', '馆藏维护', '已借出', '保留'],|
                option(value='可供借阅') 可供借阅
                option(value='馆藏维护') 馆藏维护
                option(value='已借出') 已借出
                option(value='保留') 保留
        div.form-group
            label(for='due_back') 最后归还日:
            input#due_back.form-control(type='date' name='due_back' value=(undefined === book_instance ? '' : book_instance.due_back))
        button.btn.btn-primary(type='submit') 提交

    if errors
        ul
            for error in errors
                li!=error.msg